package ddpush

import (
	"xlq-demo/library/config"
	"encoding/json"
	"xlq-demo/library/util"
)

//官网留资
type ContactPushIn struct {
	Company string
	Name string
	Phone string
	Servers string
	Email string
}
func ContactPush(in *ContactPushIn) {
	url := config.Config.Dpush.ContactRebot

	content := "官网留资\n" +
		"环境：" + config.Config.Base.Env + "\n" +
		"公司：" + in.Company + "\n" +
		"姓名：" + in.Name + "\n" +
		"电话：" + in.Phone + "\n" +
		"邮箱：" + in.Email + "\n" +
		"服务：" + in.Servers

	msg := pushMsg {
		Msgtype: "text",
		Text: pushMsgText{
			Content: content,
		},
	}
	msgBys,_ := json.Marshal(msg)
	util.HttpRequest("POST",url,msgBys,map[string]string{
		"Content-Type": "application/json",
	})

}


